<template>
	<view class="mainpadding" v-if="pageShow">
		<!-- 用户协议1 -->
		<template v-if="type==1"><view v-html="content"></view></template>
		<!-- 隐私政策2 -->
		<template v-if="type==2"><view v-html="content"></view></template>
		<!-- 关于我们3 -->
		<template v-if="type==3"><view v-html="content"></view></template>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				content: "",
				type: "",
				pageShow: false
			}
		},
		onLoad(options) {
			let type = options.type
			this.type = type
			if (type == 1) this.settitle(this.$t('login.yhxy'))
			if (type == 2) this.settitle(this.$t('login.yszc'))
			if (type == 3) this.settitle(this.$t('shezhi.gywm'))
			this.system()
		},
		methods: {
			settitle(val) {
				uni.setNavigationBarTitle({
					title: val
				})
			},
			system() {
				httpRequest.request('/api/v1/protocol/getProtocol', 'GET', {
					protocolType:this.type==1?'user_protocol':this.type==2?'user_privacy':"about_me"
				}).then(res => {
					this.content = res.data.protocolContent
					this.pageShow = true
				})
			}
		}
	}
</script>

<style>

</style>